package com.shiguiwu.springmybatis.app.controller;

import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.extension.api.R;
import com.shiguiwu.springmybatis.app.service.HelloService;
import com.shiguiwu.springmybatis.app.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: sql性能测试
 * @author: stone
 * @date: Created by 2022/8/25 13:55
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.app.controller
 */
@RestController
@Slf4j
@RequestMapping("/test/sql")
public class TestSqlController {


    @Autowired
    private HelloService helloService;

    @Autowired
    private UserService userService;

    @RequestMapping("/in")
    public R<Integer> sql() {
        log.info("当前线程 ===> {}", Thread.currentThread().getName());
        userService.test();
        return R.ok(RandomUtil.randomInt(2, 10000));

    }


}
